package edu.udlap.spring2008.is300.finalexam.framework.mvc.model;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilter;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.FormatRecord;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.SizeRecord;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.ImageRecord;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.PrivacyLevelRecord;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.CategoryRecord;
import java.util.ArrayList;

/**
 * This interface is intended to permit access to the state of a model while
 * preventing any changes to that same state.
 * 
 * This interface is to be used by views, which know exactly what they are
 * rendering (a specific model) but should not be able to change the state of
 * it.
 * 
 * @author Ruslán Ledesma Garza
 */
public interface ModelState
{
    
    /**
     * Gets an ArrayList containing all the images recorded in the database.
     * 
     * @return an ArrayList of ImageRecord.
     */
    ArrayList<ImageRecord> getAllImageRecords();
    
    /**
     * Gets an ArrayList containing the image records that match the current
     * image record filter set in the model.
     * 
     * @return an ArrayList of ImageRecord.
     */
    ArrayList<ImageRecord> getMatchingImageRecords();

    /**
     * Gets an ArrayList containing all the favorite images recorded in the
     * database.
     * 
     * @return an ArrayList of ImageRecord.
     */
    ArrayList<ImageRecord> getFavoriteImageRecords();
    
    /**
     * Gets an ArrayList containing all the categories recorded in the database.
     * 
     * @return an ArrayList of CategoryRecord.
     */
    ArrayList<CategoryRecord> getCategoryRecords();
    
    /**
     * Gets an ArrayList containing all the sizes recorded in the database.
     * 
     * @return an ArrayList of SizeRecord.
     */
    ArrayList<SizeRecord> getSizeRecords();
    
    /**
     * Gets an ArrayList containing all the privacy levels
     * recorded in the database.
     * 
     * @return an ArrayList of PrivacyLevelRecord.
     */
    ArrayList<PrivacyLevelRecord> getPrivacyLevelRecords();
    
    /**
     * Gets an ArrayList containing all the image formats recorded in the
     * database.
     * 
     * @return an ArrayList of FormatRecord.
     */
    ArrayList<FormatRecord> getFormatRecords();
    
    /**
     * Gets the currently selected image record in the model.
     * @return the currently selected image record, null if there is no image
     *         selected.
     */
    ImageRecord getSelectedImageRecord();
    
    /**
     * Gets the image record matching the given id, no matter if it is amongst
     * the criteria-matching images.
     * @param id
     * @return the image record.
     */
    ImageRecord getImageRecord(int id);
    
    /**
     * Gets the category record matching the given id.
     * 
     * @param id
     * @return the category record.
     */
    CategoryRecord getCategoryRecord(int id);
    
    /**
     * Gets the size record matching the given id.
     * 
     * @param id
     * @return the size record.
     */
    SizeRecord getSizeRecord(int id);
    
    /**
     * Gets the privacy level record matching the given id.
     * 
     * @param id
     * @return the privacy level record.
     */
    PrivacyLevelRecord getPrivacyLevelRecord(int id);
    
    /**
     * Gets the format record matching the given id.
     * 
     * @param id
     * @return the format record.
     */
    FormatRecord getFormatRecord(int id);
    
    /**
     * Gets the currently set image record filter.
     * @return the model's image record filter.
     */
    ImageRecordFilter getImageRecordFilter();
}
